﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using QLNS.Models;
namespace QLNS.Controllers
{
    public class VuController : Controller
    {
        //
        // GET: /Vu/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult addnew() {
            return View();
        }

        public ActionResult GetVuDetails()
        {
            var settings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() };
           // var nhanviens = new QLNS.api.NhanVienAPIController().Get();
            WebData data = new WebData();
            var vus = data.VUs.GetAll();
            var jsonResult = new ContentResult
            {
                Content = JsonConvert.SerializeObject(vus, settings),
                ContentType = "application/json"
            };

            return jsonResult;
        }
    }
}
